home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.0 Interfaces / AIncludes / Components.a < prev   
Encoding:
Text File  |  1993-04-08  |  15.9 KB  |  297 lines  |  [TEXT/MPS ]

  1.  
  2. ; Created: Wednesday, August 14, 1991 9:33 AM
  3. ;
  4. ; File: Components.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1990-1991
  8. ; All Rights Reserved
  9. ;
  10. ;___________________________________________________________________________
  11.  IF &TYPE('__IncludingComponents__') = 'UNDEFINED' THEN
  12. __IncludingComponents__   SET 1
  13.  
  14. gestaltComponentMgr                               EQU      'cpnt'
  15.  
  16. kAnyComponentType                                  EQU        0
  17. kAnyComponentSubType                              EQU        0
  18. kAnyComponentManufacturer                          EQU        0
  19. kAnyComponentFlagsMask                              EQU        0
  20.  
  21. cmpWantsRegisterMessage                              EQU      $80000000
  22.  
  23. ComponentDescription                              RECORD   0
  24. componentType                                     DS.L       1                       ; A unique 4-byte code indentifying the command set 
  25. componentSubType                                  DS.L       1                       ; Particular flavor of this instance 
  26. componentManufacturer                             DS.L       1                       ; Vendor indentification 
  27. componentFlags                                    DS.L       1                       ; 8 each for Component,Type,SubType,Manuf/revision 
  28. componentFlagsMask                                DS.L       1                       ; Mask for specifying which flags to consider in search, zero during registration 
  29. size                                              EQU      *
  30.                                                   ENDR
  31.  
  32. ResourceSpec                                      RECORD   0
  33. resType                                           DS.L       1                         ; 4-byte code  
  34. resId                                             DS.W       1
  35. size                                              EQU      *
  36.                                                   ENDR
  37.  
  38. ComponentResource                                 RECORD   0
  39. cd                                                DS       ComponentDescription     ; Registration parameters 
  40. component                                         DS       ResourceSpec             ; resource where Component code is found 
  41. componentName                                     DS       ResourceSpec             ; name string resource 
  42. componentInfo                                     DS       ResourceSpec             ; info string resource 
  43. componentIcon                                     DS       ResourceSpec             ; icon resource 
  44. size                                              EQU      *
  45.                                                   ENDR
  46.  
  47. ; Structure received by Component:  
  48. ComponentParameters                               RECORD   0
  49. flags                                             DS.B     1                           ; call modifiers: sync/async, deferred, immed, etc 
  50. paramSize                                         DS.B     1                           ; size in bytes of actual parameters passed to this call 
  51. what                                              DS.W       1                        ; routine selector, negative for Component management calls 
  52. params                                            DS.L     1                        ; actual parameters for the indicated routine 
  53. size                                              EQU      *
  54.                                                   ENDR
  55.  
  56.  
  57.  
  58. ;*******************************************************
  59. ;*                                                     *
  60. ;*              APPLICATION LEVEL CALLS                *
  61. ;*                                                     *
  62. ;*******************************************************
  63. ;* Component Database Add, Delete, and Query Routines 
  64. ;*******************************************************
  65.                                                   MACRO
  66.                                                   _RegisterComponent
  67.                                                   MOVEQ        #$01,D0
  68.                                                   DC.W         $A82A      ; TB 002A
  69.                                                   ENDM
  70.  
  71.                                                   MACRO
  72.                                                   _RegisterComponentResource
  73.                                                   MOVEQ        #$12,D0
  74.                                                   DC.W         $A82A      ; TB 002A
  75.                                                   ENDM
  76.  
  77.                                                   MACRO
  78.                                                   _UnregisterComponent
  79.                                                   MOVEQ        #$02,D0
  80.                                                   DC.W         $A82A      ; TB 002A
  81.                                                   ENDM
  82.  
  83.  
  84.                                                   MACRO
  85.                                                   _FindNextComponent
  86.                                                   MOVEQ        #$04,D0
  87.                                                   DC.W         $A82A      ; TB 002A
  88.                                                   ENDM
  89.  
  90.                                                   MACRO
  91.                                                   _CountComponents
  92.                                                   MOVEQ        #$03,D0
  93.                                                   DC.W         $A82A      ; TB 002A
  94.                                                   ENDM
  95.  
  96.  
  97.                                                   MACRO
  98.                                                   _GetComponentInfo
  99.                                                   MOVEQ        #$05,D0
  100.                                                   DC.W         $A82A      ; TB 002A
  101.                                                   ENDM
  102.  
  103.                                                   MACRO
  104.                                                   _GetComponentListModSeed
  105.                                                   MOVEQ        #$06,D0
  106.                                                   DC.W         $A82A      ; TB 002A
  107.                                                   ENDM
  108.  
  109.  
  110. ;*******************************************************
  111. ;* Component Instance Allocation and dispatch routines 
  112. ;*******************************************************
  113.                                                   MACRO
  114.                                                   _OpenComponent
  115.                                                   MOVEQ        #$07,D0
  116.                                                   DC.W         $A82A      ; TB 002A
  117.                                                   ENDM
  118.  
  119.                                                   MACRO
  120.                                                   _CloseComponent
  121.                                                   MOVEQ        #$08,D0
  122.                                                   DC.W         $A82A      ; TB 002A
  123.                                                   ENDM
  124.  
  125.  
  126.                                                   MACRO
  127.                                                   _GetComponentInstanceError
  128.                                                   MOVEQ        #$0A,D0
  129.                                                   DC.W         $A82A      ; TB 002A
  130.                                                   ENDM
  131.  
  132.  
  133. ; direct calls to the Components 
  134.                                                   MACRO
  135.                                                   _ComponentFunctionImplemented
  136.                                                   MOVE.L       #$0002FFFD,-(A7)
  137.                                                   MOVEQ        #$00,D0
  138.                                                   DC.W         $A82A      ; TB 002A
  139.                                                   ENDM
  140.  
  141.                                                   MACRO
  142.                                                   _GetComponentVersion
  143.                                                   MOVE.L       #$0000FFFC,-(A7)
  144.                                                   MOVEQ        #$00,D0
  145.                                                   DC.W         $A82A      ; TB 002A
  146.                                                   ENDM
  147.  
  148. ;****************************************************
  149. ;*                                                    *
  150. ;*               CALLS MADE BY Components             *
  151. ;*                                                    *
  152. ;******************************************************
  153. ;******************************************************
  154. ;* Required Component routines
  155. ;******************************************************
  156. kComponentOpenSelect                              EQU      -1                       ; ComponentInstance for this open 
  157. kComponentCloseSelect                             EQU      -2                       ; ComponentInstance for this close 
  158. kComponentCanDoSelect                             EQU      -3                       ; selector # being queried 
  159. kComponentVersionSelect                           EQU      -4                       ; no params 
  160. kComponentRegisterSelect                          EQU      -5                       ; no params 
  161. kComponentTargetSelect                            EQU      -6                       ; ComponentInstance for top of call chain 
  162.  
  163. ;*******************************************************
  164. ;* Component Management routines
  165. ;*******************************************************
  166.                                                   MACRO
  167.                                                   _SetComponentInstanceError
  168.                                                   MOVEQ        #$0B,D0
  169.                                                   DC.W         $A82A      ; TB 002A
  170.                                                   ENDM
  171.  
  172.  
  173.                                                   MACRO
  174.                                                   _GetComponentRefcon
  175.                                                   MOVEQ        #$10,D0
  176.                                                   DC.W         $A82A      ; TB 002A
  177.                                                   ENDM
  178.  
  179.                                                   MACRO
  180.                                                   _SetComponentRefcon
  181.                                                   MOVEQ        #$11,D0
  182.                                                   DC.W         $A82A      ; TB 002A
  183.                                                   ENDM
  184.  
  185.  
  186.                                                   MACRO
  187.                                                   _OpenComponentResFile
  188.                                                   MOVEQ        #$15,D0
  189.                                                   DC.W         $A82A      ; TB 002A
  190.                                                   ENDM
  191.  
  192.                                                   MACRO
  193.                                                   _CloseComponentResFile
  194.                                                   MOVEQ        #$18,D0
  195.                                                   DC.W         $A82A      ; TB 002A
  196.                                                   ENDM
  197.  
  198.  
  199. ;*******************************************************
  200. ;* Component Instance Management routines
  201. ;*******************************************************
  202.                                                   MACRO
  203.                                                   _GetComponentInstanceStorage
  204.                                                   MOVEQ        #$0C,D0
  205.                                                   DC.W         $A82A      ; TB 002A
  206.                                                   ENDM
  207.  
  208.                                                   MACRO
  209.                                                   _SetComponentInstanceStorage
  210.                                                   MOVEQ        #$0D,D0
  211.                                                   DC.W         $A82A      ; TB 002A
  212.                                                   ENDM
  213.  
  214.  
  215.                                                   MACRO
  216.                                                   _GetComponentInstanceA5
  217.                                                   MOVEQ        #$0E,D0
  218.                                                   DC.W         $A82A      ; TB 002A
  219.                                                   ENDM
  220.  
  221.                                                   MACRO
  222.                                                   _SetComponentInstanceA5
  223.                                                   MOVEQ        #$0F,D0
  224.                                                   DC.W         $A82A      ; TB 002A
  225.                                                   ENDM
  226.  
  227.  
  228.                                                   MACRO
  229.                                                   _CountComponentInstances
  230.                                                   MOVEQ        #$13,D0
  231.                                                   DC.W         $A82A      ; TB 002A
  232.                                                   ENDM
  233.  
  234.  
  235. ; useful helper routines for convenient method dispatching 
  236.                                                   MACRO
  237.                                                   _CallComponentFunction
  238.                                                   MOVEQ        #$FF,D0
  239.                                                   DC.W         $A82A      ; TB 002A
  240.                                                   ENDM
  241.  
  242.                                                   MACRO
  243.                                                   _CallComponentFunctionWithStorage
  244.                                                   MOVEQ        #$FF,D0
  245.                                                   DC.W         $A82A      ; TB 002A
  246.                                                   ENDM
  247.  
  248.                                                   MACRO
  249.                                                   _DelegateComponentCall
  250.                                                   MOVEQ        #$24,D0
  251.                                                   DC.W         $A82A      ; TB 002A
  252.                                                   ENDM
  253.  
  254. ; Set Default Component flags 
  255. defaultComponentIdentical                         EQU      0
  256. defaultComponentAnyFlags                          EQU      1
  257. defaultComponentAnyManufacturer                   EQU      2
  258. defaultComponentAnySubType                        EQU      4
  259. defaultComponentAnyFlagsAnyManufacturer           EQU      defaultComponentAnyFlags+defaultComponentAnyManufacturer
  260. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU      defaultComponentAnyFlags+defaultComponentAnyManufacturer+defaultComponentAnySubType
  261.  
  262.                                                   MACRO
  263.                                                   _SetDefaultComponent
  264.                                                   MOVEQ        #$1E,D0
  265.                                                   DC.W         $A82A      ; TB 002A
  266.                                                   ENDM
  267.  
  268.                                                   MACRO
  269.                                                   _OpenDefaultComponent
  270.                                                   MOVEQ        #$21,D0
  271.                                                   DC.W         $A82A      ; TB 002A
  272.                                                   ENDM
  273.  
  274.                                                   MACRO
  275.                                                   _CaptureComponent
  276.                                                   MOVEQ        #$1C,D0
  277.                                                   DC.W         $A82A      ; TB 002A
  278.                                                   ENDM
  279.  
  280.                                                   MACRO
  281.                                                   _UncaptureComponent
  282.                                                   MOVEQ        #$1D,D0
  283.                                                   DC.W         $A82A      ; TB 002A
  284.                                                   ENDM
  285.  
  286.  
  287. ; errors from component manager & components
  288. invalidComponentID                                  EQU        -3000
  289. validInstancesExist                                  EQU        -3001
  290. componentNotCaptured                              EQU        -3002
  291. componentDontRegister                              EQU        -3003
  292.  
  293. badComponentInstance                              EQU        $80008001
  294. badComponentSelector                              EQU        $80008002
  295.  
  296.  
  297.                                                   ENDIF    ;   ...already included